package result

// 响应给前端的 data 结构
type ResponseList struct {
	PageNo     int         `json:"pageNo"`
	PageSize   int         `json:"pageSize"`
	TotalCount int64       `json:"totalCount"`
	TotalPage  int64       `json:"totalPage"`
	Data       interface{} `json:"data"`
}

type ResponseConfigList struct {
	Host       string      `json:"host"`
	PageNo     int         `json:"pageNo"`
	PageSize   int         `json:"pageSize"`
	TotalCount int64       `json:"totalCount"`
	TotalPage  int64       `json:"totalPage"`
	Data       interface{} `json:"data"`
}

// API 权限操作颗粒度
type Action struct {
	Describe       string `json:"describe"`
	Action         string `json:"action"`
	DefaultChecked bool   `json:"defaultChecked"`
}

type ActionList []*Action

// 响应给前端的API权限操作颗粒度
func NewActionList() ActionList {
	return ActionList{
		&Action{Describe: "新增", Action: "add", DefaultChecked: false},
		&Action{Describe: "详情", Action: "get", DefaultChecked: false},
		&Action{Describe: "修改", Action: "update", DefaultChecked: false},
		&Action{Describe: "查询", Action: "query", DefaultChecked: false},
		&Action{Describe: "列表", Action: "list", DefaultChecked: false},
		&Action{Describe: "删除", Action: "delete", DefaultChecked: false},
		&Action{Describe: "导入", Action: "import", DefaultChecked: false},
		&Action{Describe: "导出", Action: "export", DefaultChecked: false},
		&Action{Describe: "启用", Action: "enable", DefaultChecked: false},
		&Action{Describe: "禁用", Action: "disable", DefaultChecked: false},
		&Action{Describe: "绑定", Action: "bind", DefaultChecked: false},
		&Action{Describe: "解绑", Action: "unbind", DefaultChecked: false},
		&Action{Describe: "同步", Action: "sync", DefaultChecked: false},
		&Action{Describe: "无奖励", Action: "reward", DefaultChecked: false},
	}
}

type Menu struct {
	Name    string   `json:"name"`
	Path    string   `json:"path"`
	Url     string   `json:"url"`
}

type MenuList []Menu

func NewMenuList() MenuList {
	return MenuList{
		Menu{ Name:  "门店管理", Path:  "place", Url:   "/pages/index/network/network" },
		Menu{ Name:  "团队管理", Path:  "team", Url:   "/pages/index/team/team" },
		Menu{ Name:  "订单管理", Path:  "order", Url:   "/pages/order/order" },
		Menu{ Name:  "收益明细", Path:  "income", Url:   "/pages/index/incomeRecords" },
		Menu{ Name:  "设备管理", Path:  "device", Url:   "/pages/index/deviceManagement" },
		Menu{ Name:  "经营分析", Path:  "business", Url:   "/pages/management/management" },
	}
}


type Tab struct {
	Text                string   `json:"text"`
	PagePath            string   `json:"pagePath"`
	SelectedIconPath    string   `json:"selectedIconPath"`
	IconPath            string   `json:"iconPath"`
}

type TabList []Tab

func NewTabListToPlace() TabList {
	return TabList{
		Tab{ Text:  "首页", IconPath:  "home", SelectedIconPath: "activeHome", PagePath:   "/pages/index/index" },
		Tab{ Text:  "工单", IconPath:  "order", SelectedIconPath: "activeOrder", PagePath:   "/pages/personal/workOrderList/workOrderList" },
		Tab{ Text:  "资产", IconPath:  "cash", SelectedIconPath: "activeCash", PagePath:   "/pages/wallet/withdrawal/withdrawal" },
		Tab{ Text:  "我的", IconPath:  "my", SelectedIconPath: "activeMy", PagePath:   "/pages/personal/personal" },
	}
}

func NewTabListToAgent() TabList {
	return TabList{
		Tab{ Text:  "首页", IconPath:  "home", SelectedIconPath: "activeHome", PagePath:   "/pages/index/index" },
		Tab{ Text:  "经营", IconPath:  "business", SelectedIconPath: "activeBusiness", PagePath:   "/pages/management/management" },
		Tab{ Text:  "资产", IconPath:  "cash", SelectedIconPath: "activeCash", PagePath:   "/pages/wallet/withdrawal/withdrawal" },
		Tab{ Text:  "我的", IconPath:  "my", SelectedIconPath: "activeMy", PagePath:   "/pages/personal/personal" },
	}
}

func NewTabListToWifiUser() TabList {
	return TabList{
		Tab{ Text:  "首页", IconPath:  "home", SelectedIconPath: "activeHome", PagePath:   "/pages/wifi/index" },
		Tab{ Text:  "资产", IconPath:  "cash", SelectedIconPath: "activeCash", PagePath:   "/pages/wifi/wifi" },
		Tab{ Text:  "我的", IconPath:  "my", SelectedIconPath: "activeMy", PagePath:   "/pages/wifi/personal" },
	}
}


